#ifndef PARSER_H
#define PARSER_H

#include "Rule.h"
#include "../Scanner-Automat/Token.h"

class Scanner;
class Node;

class Parser {
public:
	Parser(Scanner &newScanner);
	~Parser();

	void parse();

	Node* prog();
	Node* decls();
	Node* statements();
	Node* statement();
	Node* decl();
	Node* array();
	Node* index();
	Node* exp();
	Node* exp2();
	Node* op();
	Node* op_exp();

private:
	Rule rule;
	Scanner &scanner;
	Token currentToken;
	Node* root;

	bool nextToken();
	void error();
	bool checkTT(TokenType type);
};

#endif
